package com.xzh.mallorderspi.service;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xzh.mallorderspi.model.Order;
import com.xzh.mallorderspi.model.search.OrderSeaechBean;
import com.xzh.mallorderspi.model.search.Sales;

import java.time.LocalDate;
import java.util.List;
import java.util.Map;

public interface OrderService {

    //查询所有订单
    Page<Order> findAll(OrderSeaechBean osb, Page<Order> page);

    //查询唯一订单
    Order findById(Integer id);

    //订单编号
    Order findByOrderNo(String orderNo);

    //根据秒杀单号查询订单
    Order findBySeckillNo(String seckillNo);

    //保存订单
    boolean save(Order order);

    //修改订单
    boolean update(Order order);

    //发货
    boolean updateForShip(Integer orderId);

    //确认收货
    boolean updateForAccept(Integer orderId);

    /**
     * 批量删除订单
     *
     * @param ids   订单编号
     * @param logic 是否逻辑删除
     * @return 删除的行数
     */
    int deleteByIds(List<Integer> ids, boolean logic);

    //创建秒杀订单
    boolean seckill(Order order);
    /**
     * 订单图像数据
     */
    Sales getKeyMetrics(LocalDate startDate, LocalDate endDate);

    List<Map<String, Object>> getPayType(LocalDate startDate, LocalDate endDate);
}
